-
Notifications
You must be signed in to change notification settings - Fork 58
Create schema classes [5267] #3691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create schema classes [5267] #3691
Conversation
Test using WordPress PlaygroundThe changes in this pull request can be previewed and tested using a WordPress Playground instance. 🔗 Test this pull request with WordPress Playground What's included:
Login credentials:
Plugin Details:
🤖 Auto-generated for commit cc36495 • Last updated: 2025-10-21T08:52:39.610Z |
afc7198 to
7d3b639
Compare
# Conflicts: # modules/ppcp-agentic-commerce/src/Endpoint/AgenticRestEndpoint.php
# Conflicts: # modules/ppcp-agentic-commerce/src/Endpoint/AgenticRestEndpoint.php
# Conflicts: # modules/ppcp-agentic-commerce/src/Endpoint/AgenticRestEndpoint.php
# Conflicts: # modules/ppcp-agentic-commerce/src/Endpoint/AgenticRestEndpoint.php
666ffe2 to
7fa2f19
Compare
Description
Implements PHP schema classes for the PayPal Cart API v1, enabling type-safe parsing and validation of cart data for the Agentic Commerce integration.
These classes provide structured data objects matching PayPal's API specification. All incoming cart data from external AI agents will be parsed through these schemas before reaching business logic.
Core schemas: PayPalCart, PayPalCartResponse, ValidationIssue
Component schemas: CartItem, Customer, Address, GeoCoordinates, PaymentMethod, CheckoutField
Utility schemas: Money, AppliedCoupon, CartTotals, Coupon, ShippingOption, GiftOptions
Design Decisions
Forgiving parsers: Validate data format while preserving both valid and invalid data for downstream business validation. The
to_array()method intentionally returns potentially invalid or incomplete input dataImmutable DTOs: All schemas are immutable value objects